3.986 \(\int x^m (1-a x)^n (1+a x)^n \, dx\)

Optimal. Leaf size=36 \[ \frac{x^{m+1} \, _2F_1\left (\frac{m+1}{2},-n;\frac{m+3}{2};a^2 x^2\right )}{m+1} \]

[Out]

(x^(1 + m)*Hypergeometric2F1[(1 + m)/2, -n, (3 + m)/2, a^2*x^2])/(1 + m)

________________________________________________________________________________________

Rubi [A]  time = 0.0125551, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.105, Rules used = {125, 364} \[ \frac{x^{m+1} \, _2F_1\left (\frac{m+1}{2},-n;\frac{m+3}{2};a^2 x^2\right )}{m+1} \]

Antiderivative was successfully verified.

[In]

Int[x^m*(1 - a*x)^n*(1 + a*x)^n,x]

[Out]

(x^(1 + m)*Hypergeometric2F1[(1 + m)/2, -n, (3 + m)/2, a^2*x^2])/(1 + m)

Rule 125

Int[((f_.)*(x_))^(p_.)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[(a*c + b*d*x^2)
^m*(f*x)^p, x] /; FreeQ[{a, b, c, d, f, m, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[m - n, 0] && GtQ[a, 0] && GtQ
[c, 0]

Rule 364

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(a^p*(c*x)^(m + 1)*Hypergeometric2F1[-
p, (m + 1)/n, (m + 1)/n + 1, -((b*x^n)/a)])/(c*(m + 1)), x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rubi steps

\begin{align*} \int x^m (1-a x)^n (1+a x)^n \, dx &=\int x^m \left (1-a^2 x^2\right )^n \, dx\\ &=\frac{x^{1+m} \, _2F_1\left (\frac{1+m}{2},-n;\frac{3+m}{2};a^2 x^2\right )}{1+m}\\ \end{align*}

Mathematica [A]  time = 0.0085413, size = 38, normalized size = 1.06 \[ \frac{x^{m+1} \, _2F_1\left (\frac{m+1}{2},-n;\frac{m+1}{2}+1;a^2 x^2\right )}{m+1} \]

Antiderivative was successfully verified.

[In]

Integrate[x^m*(1 - a*x)^n*(1 + a*x)^n,x]

[Out]

(x^(1 + m)*Hypergeometric2F1[(1 + m)/2, -n, 1 + (1 + m)/2, a^2*x^2])/(1 + m)

________________________________________________________________________________________

Maple [F]  time = 0.125, size = 0, normalized size = 0. \begin{align*} \int{x}^{m} \left ( -ax+1 \right ) ^{n} \left ( ax+1 \right ) ^{n}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^m*(-a*x+1)^n*(a*x+1)^n,x)

[Out]

int(x^m*(-a*x+1)^n*(a*x+1)^n,x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a x + 1\right )}^{n}{\left (-a x + 1\right )}^{n} x^{m}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^m*(-a*x+1)^n*(a*x+1)^n,x, algorithm="maxima")

[Out]

integrate((a*x + 1)^n*(-a*x + 1)^n*x^m, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (a x + 1\right )}^{n}{\left (-a x + 1\right )}^{n} x^{m}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^m*(-a*x+1)^n*(a*x+1)^n,x, algorithm="fricas")

[Out]

integral((a*x + 1)^n*(-a*x + 1)^n*x^m, x)

________________________________________________________________________________________

Sympy [C]  time = 156.858, size = 202, normalized size = 5.61 \begin{align*} \frac{a^{- m}{G_{6, 6}^{5, 3}\left (\begin{matrix} - \frac{m}{2} - \frac{n}{2}, - \frac{m}{2} - \frac{n}{2} + \frac{1}{2}, 1 & \frac{1}{2} - \frac{m}{2}, - \frac{m}{2} - n, - \frac{m}{2} - n + \frac{1}{2} \\- \frac{m}{2} - n - \frac{1}{2}, - \frac{m}{2} - n, - \frac{m}{2} - \frac{n}{2}, - \frac{m}{2} - n + \frac{1}{2}, - \frac{m}{2} - \frac{n}{2} + \frac{1}{2} & 0 \end{matrix} \middle |{\frac{e^{- 2 i \pi }}{a^{2} x^{2}}} \right )} e^{- i \pi m} e^{- i \pi n}}{4 \pi a \Gamma \left (- n\right )} - \frac{a^{- m}{G_{6, 6}^{2, 6}\left (\begin{matrix} - \frac{m}{2} - \frac{1}{2}, - \frac{m}{2}, \frac{1}{2} - \frac{m}{2}, - \frac{m}{2} - \frac{n}{2} - \frac{1}{2}, - \frac{m}{2} - \frac{n}{2}, 1 & \\- \frac{m}{2} - \frac{n}{2} - \frac{1}{2}, - \frac{m}{2} - \frac{n}{2} & - \frac{m}{2} - \frac{1}{2}, - \frac{m}{2}, - \frac{m}{2} - n - \frac{1}{2}, 0 \end{matrix} \middle |{\frac{1}{a^{2} x^{2}}} \right )}}{4 \pi a \Gamma \left (- n\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**m*(-a*x+1)**n*(a*x+1)**n,x)

[Out]

a**(-m)*meijerg(((-m/2 - n/2, -m/2 - n/2 + 1/2, 1), (1/2 - m/2, -m/2 - n, -m/2 - n + 1/2)), ((-m/2 - n - 1/2,
-m/2 - n, -m/2 - n/2, -m/2 - n + 1/2, -m/2 - n/2 + 1/2), (0,)), exp_polar(-2*I*pi)/(a**2*x**2))*exp(-I*pi*m)*e
xp(-I*pi*n)/(4*pi*a*gamma(-n)) - a**(-m)*meijerg(((-m/2 - 1/2, -m/2, 1/2 - m/2, -m/2 - n/2 - 1/2, -m/2 - n/2,
1), ()), ((-m/2 - n/2 - 1/2, -m/2 - n/2), (-m/2 - 1/2, -m/2, -m/2 - n - 1/2, 0)), 1/(a**2*x**2))/(4*pi*a*gamma
(-n))

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a x + 1\right )}^{n}{\left (-a x + 1\right )}^{n} x^{m}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^m*(-a*x+1)^n*(a*x+1)^n,x, algorithm="giac")

[Out]

integrate((a*x + 1)^n*(-a*x + 1)^n*x^m, x)